package com.jtcoding.chat.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jtcoding.chat.exception.ApiException;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Base64;

import static com.jtcoding.chat.common.enums.ResultCode.FILE_DOES_NOT_EXIST;

/**
 * @author jason.tang
 * @create 2019-01-14 9:20
 * @description
 */

@ApiModel(description = "资源封装类")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
public class FastDFSResource {
    @ApiModelProperty(value = "文件名", required = true)
    private String name;

    @ApiModelProperty(value = "文件内容")
    @JsonIgnore
    private byte[] content;

    @ApiModelProperty(value = "来自哪个服务", required = true)
    private String fromService;

    @ApiModelProperty(value = "资源类型", required = true)
    private String resType;

    @ApiModelProperty(value = "参考编号")
    private Integer refNum;
}